<?php
$sql = "select * from dongho where 1 ";
$mansx = isset($_REQUEST["mansx"])?$_REQUEST["mansx"]:"";
if ($mansx !="")
{
	$sql .=" and mansx='$mansx' ";	
}

$maloai = isset($_REQUEST["maloai"])?$_REQUEST["maloai"]:"";
if ($maloai !="")
{
	$sql .=" and maloai='$maloai' ";	
}

$tendh = isset($_REQUEST["tendh"])?$_REQUEST["tendh"]:"";
if ($tendh !="")
{
	$sql .=" and tendh like'%$tendh%' ";	
}

$gia = isset($_REQUEST["gia"])?$_REQUEST["gia"]:"";
if ($gia !="")
{
	
	if ($gia =="2")
	{
	$sql .=" and gia between 25000000 and 50000000";
	}
	else if ($gia =="3")
	{
	$sql .=" and gia between 50000000 and 75000000";
	}
	else if ($gia =="4")
	{
	$sql .=" and gia between 75000000 and 100000000";
	}
	else if ($gia =="1")
	{
	$sql .=" and gia < 25000000";
	}
	else if ($gia =="5")
	{
	$sql .=" and gia > 100000000";
	}
	
		
}



$result = mysql_query($sql);
while($r = mysql_fetch_array($result))
{
	echo "<div class=product>";
	$t = $r["tendh"]; $g= $r["gia"]; $h="Images_product/". $r["hinh"];
	echo "$t<br>";
	echo "<img src='$h' height=195 width=150><br>";
	echo "<table height=40><tr><td width=92> $g VNĐ </td><td> <img src='image/cart.jpg' height=40 width=50><td></tr></table><br>";
	echo "</div>";
}
?>